//
//  AvReadioPlayer.m
//  Everest
//
//  Created by 李其昌 on 14/12/25.
//  Copyright (c) 2014年 ThreeL. All rights reserved.
//

#import "AvReadioPlayer.h"

@implementation AvReadioPlayer
+ (AvReadioPlayer *)defaultAvPlayer
{
    static AvReadioPlayer *avplayer = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        avplayer = [[AvReadioPlayer alloc] init];
    });
    return avplayer;
}

- (void)playWithUrl:(NSURL *)url
{
    AVPlayerItem *item = [[AVPlayerItem alloc] initWithURL:url];
    [self replaceCurrentItemWithPlayerItem:item];
    [self play];
    [item release];
}

@end
